The present invention relates generally to an improved communications system and in particular to a method and apparatus for managing message content. Still more particularly, the present invention provides a method and apparatus for handling information from a Session Initiation Protocol message.
Session Initiation Protocol (SIP) is an application-layer control (signaling) protocol for creating, modifying and terminating sessions with one or more participants. These sessions include Internet multimedia conferences, Internet telephone calls and multimedia distribution. Members in a session can communicate via multicast or via a mesh of unicast relations, or a combination of these.
SIP invitations used to create sessions carry session descriptions, which allow participants to agree on a set of compatible media types. SIP supports user mobility by proxying and redirecting requests to the user""s current location. Users can register their current location. SIP is not tied to any particular conference control protocol. SIP is designed to be independent of the lower-layer transport protocol and can be extended with additional capabilities.
SIP can be used to initiate sessions as well as invite members to sessions that have been advertised and established by other means. Sessions can be advertised using multicast protocols such as SAP, electronic mail, news groups, Web pages or directories (LDAP), among others.
SIP transparently supports name mapping and redirection services, allowing the implementation of ISDN and Intelligent Network telephony subscriber services. These facilities also enable personal mobility. Personal mobility is the ability of end users to originate and receive calls and access subscribed telecommunication services on any terminal in any location, and the ability of the network to identify end users as they move. Personal mobility is based on the use of a unique personal identity (i.e. personal number. Personal mobility complements terminal mobility, such as the ability to maintain communications when moving a single end system from one subnet to another. SIP supports five facets of establishing and terminating multimedia communications: (1) user location: determination of the end system to be used for communication; (2) user capabilities: determination of the media and media parameters to be used; (3) user availability: determination of the willingness of the called party to engage in communications; (4) call setup: xe2x80x9cringingxe2x80x9d, establishment of call parameters at both called and calling party; and (5) call handling: including transfer and termination of calls.
SIP is a text based protocol and uses the ISO 10646 character set in UTF-8 encoding. A SIP message is either a request from a client to a server or a response from a server to a client. Both of these types of messages contain a start line, one or more header fields, an empty line indicating the end of the header fields, and an optional message body. These header fields are also referred to as xe2x80x9cheadersxe2x80x9d. In processing a SIP message, different SIP message headers have different characteristics with respect to the frequency of occurrence in SIP messages. Some headers, such as, for example, a xe2x80x9cToxe2x80x9d header is a general header that appears only once while other header, such as, for example, a xe2x80x9cViaxe2x80x9d header is a general header that can appear any number of times. Presently, these headers are stored in data structures, such as an array as they are parsed out of the message. Such a storage mechanism is inefficient. The execution of SIP logic in some cases requires selected headers or all headers of a particular type to be located. Scanning an entire array to find required headers is inefficient, especially when headers may be required numerous times during processing of a message.
Therefore, it would be advantageous to have a method and apparatus for locating information parsed from a message.
The present invention provides an improved method, apparatus, and instructions for storing and locating information parsed from a message. The mechanism provided for storing and locating information reduces the amount of resources needed to locate information at a later time. Headers parsed from a message are stored in a vector. This vector is also referred to as a header vector and headers are stored in the vector in the order that the headers are parsed from the message. A header hash table is created. This hash table contains a unique key for each type of header. This hash table is indexed by a string representation of the header type in these examples. The value of each entry in the header hash table is a vector in which the integer indices for entries in the header vector are stored. Thus, to extract or identify all message headers of a selected type, the key associated with the type is used to identify a hash table entry containing an index vector. This index vector contains identifiers or integer indices to all of the entries in the header vector containing the selected type of message header. The indices in the index vector are used to locate headers of the same type without having to search the entire header vector.
Other aspects and features of the present invention will become apparent to those ordinarily skilled in the art upon review of the following description of specific embodiments of the invention in conjunction with the accompanying figures.